#pragma once

#ifndef QueryEvaluator_h
#define QueryEvaluator_H

#include "PKB.h"
#include "Standards.h"

class QueryEvaluator 
{
	public:
		QueryEvaluator(PKB*);
		vector<string> evaluate(vector<vector<string>>);
	private:
		PKB* myPKB;

		Schema initAnswer;
		Schema finalAnswer;

		string operand;
		string operandType;
		bool hasEndsWith(string, char);
		bool checkNAME(string);
		bool validateNAME(string);
		bool validateNAMEINTEGER(string);
		bool match(string, string);
		bool match(string, string, string);
	
		Schema evaluateSuchThat(vector<string>);
		Schema evaluatePattern(vector<string>);
		Schema evaluateWith(vector<string>);

		string relationship;
		string firstPara;
		string secondPara;
		string firstParaType;
		string secondParaType;
		string firstParamSynType;
		string secondParamSynType;

		Schema evaluateCalls();
		Schema evaluateCallsClosure();
		Schema evaluateParent();
		Schema evaluateParentClosure();
		Schema evaluateFollows();
		Schema evaluateFollowsClosure();
		Schema evaluateNext();
		Schema evaluateNextClosure();
		Schema evaluateAffects();
		Schema evaluateAffectsClosure();
		Schema evaluateModifies();
		Schema evaluateUses();

		string checkValidityOfParamStmtRef(string);
		void checkValidityOfParamEntRef(string);
};
#endif